<html>
<head><meta charset="utf-8"><title>Is adding trait to the prelude limited to edition boundary ? · edition 2021 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/index.html">edition 2021</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html">Is adding trait to the prelude limited to edition boundary ?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="224556055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224556055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224556055">(Jan 30 2021 at 00:53)</a>:</h4>
<p>Is adding trait to the prelude limited to edition boundary ?<br>
Currently the Not trait is not in the prelude. There are suggestion to add that trait to the new 2021 edition prelude.<br>
Are edition 2018 and 2015 not affected at all and not have Not trait in their prelude ?</p>



<a name="224556998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224556998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224556998">(Jan 30 2021 at 01:08)</a>:</h4>
<p>the current import is an implicit <code>use {core,std}::prelude::v1::*;</code></p>



<a name="224557022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224557022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224557022">(Jan 30 2021 at 01:09)</a>:</h4>
<p>the idea is that we'd make a new module instead of <code>v1</code>, and only code in the new edition would change to that path</p>



<a name="224557056"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224557056" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224557056">(Jan 30 2021 at 01:09)</a>:</h4>
<p>I suppose that new path would be visible if older editions wanted to manually import it</p>



<a name="224557937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224557937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224557937">(Jan 30 2021 at 01:27)</a>:</h4>
<p>Thanks, I forgot about v1 module.<br>
I think there is very small chance trait will be added to older editions prelude.</p>



<a name="224564355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224564355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224564355">(Jan 30 2021 at 04:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="209117">lzutao</span> <a href="#narrow/stream/268952-edition/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F/near/224556055">said</a>:</p>
<blockquote>
<p>Is adding trait to the prelude limited to edition boundary ?</p>
</blockquote>
<p>It's "minor", and thus allowed, breakage.  So it would depend on the trait and its impls -- if the method names on the trait are uncommon enough, it could just be added to all editions.</p>



<a name="224564415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224564415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224564415">(Jan 30 2021 at 04:14)</a>:</h4>
<p>(<code>TryFrom</code>/<code>TryInto</code> are being talked about for the edition because <a href="https://lib.rs/crates/try_from">https://lib.rs/crates/try_from</a> is popular enough that waiting for the edition has been considered worth it.)</p>



<a name="224566604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224566604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224566604">(Jan 30 2021 at 05:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="125270">scottmcm</span> <a href="#narrow/stream/268952-edition/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F/near/224564355">said</a>:</p>
<blockquote>
<p>It's "minor", and thus allowed, breakage.  So it would depend on the trait and its impls -- if the method names on the trait are uncommon enough, it could just be added to all editions.</p>
</blockquote>
<p>Thanks, it's nice to hear that from a lang member perspective.</p>
<p>Do we need to open PRs to invest breakage via crater for each trait ?</p>



<a name="224600328"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Is%20adding%20trait%20to%20the%20prelude%20limited%20to%20edition%20boundary%20%3F/near/224600328" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Is.20adding.20trait.20to.20the.20prelude.20limited.20to.20edition.20boundary.20.3F.html#224600328">(Jan 30 2021 at 19:15)</a>:</h4>
<p>Prelude additions with trait methods are fairly untread ground, so it's hard to say.</p>
<p>The prelude is somewhat special, so probably?  Largely because the number of crates in question would probably be very low, if it was being considered for an existing prelude.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>